package com.freesun.shop.config;

import ma.glasnost.orika.MapperFacade;
import ma.glasnost.orika.MapperFactory;
import ma.glasnost.orika.impl.DefaultMapperFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OrikaConfig {

    /**
     * 对外提供的接口，可以完成对对象decopy
     * @return
     */
    @Bean
    public MapperFacade mapperFacade() {
        MapperFactory mapperFactory=new DefaultMapperFactory.Builder().build();

        return mapperFactory.getMapperFacade();
    }
}
